home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / multibak.arc / MULTIBAK.DOC < prev    next >
Text File  |  1989-10-24  |  19KB  |  418 lines

  1.              MULTIBAK: A Multiple Generation File Backup Utility
  2.  
  3.                         Copyright 1989 Gilbert Shapiro
  4.  
  5.                                   **********
  6.  
  7.  
  8.                                   I. Purpose
  9.  
  10. Many microcomputer programs that modify files, such as word processors, data
  11. base managers, and spreadsheets, provide for a single generation of backup,
  12. usually renaming the old version of "filename.ext" to "filename.bak" before
  13. writing a new "filename.ext" to disk. When a new revision is again saved, the
  14. old version again becomes "filename.bak," wiping out the backup file saved
  15. earlier.  This is not always satisfactory. We may change our minds about a
  16. major change later, and want to return the document or the spreadsheet to its
  17. state several generations earlier. We may even discover much later a major
  18. error and the loss of earlier versions could seriously set our work back. For
  19. these reasons, some mainframe operating systems provide the option of multiple
  20. generations of backup.  Not only the previous version of a file, but as many
  21. generations as the user wishes (or as many as can fit in his disk space) can
  22. be preserved. MULTIBAK is a set of programs intended to provide the most
  23. important features of such mainframe services for MSDOS systems.
  24.  
  25. Any computer work that creates multiple changes in files can be made less
  26. frustrating and safer from disaster by using this collection of programs. 
  27. When editing a document or developing a spreadsheet, for example, one might
  28. create a backup almost at the stroke of a key whenever significant changes are
  29. made, accumulating them until a final version is completed and verified. The
  30. backup files can then be conveniently erased using the PURGE program provided.  
  31.  
  32.  
  33.  
  34.                          II. Versions of MULTIBAK
  35.  
  36. This is the freely distributed version of MULTIBAK.  You are invited to  make
  37. as many copies of this program as you wish for your own use or the use of
  38. others, for non-commercial purposes. You may not, however, charge anything for
  39. MULTIBAK (except for user groups, who may charge a cost-based fee, not to
  40. exceed $10, to cover their own costs).
  41.  
  42. The free version of MULTIBAK consists of the following files:
  43.  
  44.     MULTIBAK.DOC    This file.
  45.     MBC.EXE         The COPY model of MULTIBAK.
  46.     MBR.EXE         The RENAME model of MULTIBAK.
  47.     PURGE.EXE       A program for conveniently and safely erasing backup files.
  48.  
  49. These programs comprise a fully functional system that will be sufficient for
  50. many users.  A more elaborate system, with additional conveniences, is
  51. also available. If you send $20 to:
  52.  
  53.     CN Software, Dept. 190
  54.     414 S. Craig St., Suite 280
  55.     Pittsburgh, PA 15213
  56.  
  57. as a registered user of MULTIBAK you will receive a copy of an enhanced
  58. system, which includes 
  59.  
  60.     1. MEMORY RESIDENT versions of both the COPY and RENAME models. These make 
  61.         MULTIBAK available to the user at the touch of a Hot Key of his choice,
  62.         permitting execution from within programs that do not provide
  63.         facilities for the execution of DOS commands.
  64.  
  65.     2. Two additional utilities: REVERT, which quickly and simply returns you to
  66.         an earlier version of your file while preserving the current version,
  67.         and RENUMBER, a facility to change a broken series of backup names to
  68.         an unbroken series beginning at number one.
  69.  
  70.  
  71.                       III. General Functions of MULTIBAK
  72.  
  73. MULTIBAK saves the current version of a file under a new file name; it is
  74. normally called immediately prior to issuing a "save" command to some program,
  75. such as a word processor, to write a new version.  The name of the backup file
  76. is, by default, provided by MULTIBAK.  Unless over-ridden by the user, by means
  77. described below, it is constructed as follows:
  78.  
  79.      - The drive, directory, and first file name are identical with the 
  80.        original file.
  81.      - The extension is the first character of the extension of the original 
  82.        file, followed by the lowest integer from 1 to 99 not yet used in
  83.        backup versions of that file. If  the original file has no extension,
  84.        the backup file extension will begin with a dash:  for example, the first
  85.        backup of MYFILE.  will be MYFILE.-1, the second MYFILE.-2.
  86.  
  87. Thus, if the file to be backed up is MYFILE.EXT, the first call to MULTIBAK
  88. will produce a backup file named MYFILE.E1, the second backup will be called
  89. MYFILE.E2, and so on.  If, after the call to MULTIBAK, a new version is saved
  90. by a spreadsheet or word processor, it can always have the original name,
  91. MYFILE.EXT. Note that the preservation of the first letter of the original
  92. extension permits us to distinguish the backups of MYPROG.C, MYPROG.EXE and
  93. MYPROG.DOC, which will, respectively, have extensions beginning with C, E, and
  94. D. (The backups of MYFILE.BAS, MYFILE.BAT, and MYFILE.BAK will be jumbled
  95. together, however.) 
  96.  
  97. The COPY model, MBC.EXE, creates a new backup file by copying the current
  98. version, without disturbing the original.  The RENAME model, MBR.EXE, on the
  99. other hand, calls upon DOS to rename the original, changing the name in
  100. the directory. Generally, these two procedures behave like the DOS commands
  101. with the same names, but with one exception:  the RENAME model of MULTIBAK
  102. permits backups to appear in a directory different from the directory of the
  103. original file, which the DOS command does not. Like the DOS "copy" command,
  104. the COPY model of MULTIBAK permits backups to a different drive, while the
  105. RENAME model, like the rename command in DOS, does not. Like the DOS "copy"
  106. command, the COPY model of MULTIBAK keeps the original file intact, under its
  107. original name; like the "rename" command, the RENAME model does not, since it
  108. changes the file's name. On the other hand, long files can take considerably
  109. longer to back up using the COPY model, although they can be RENAMEd in an
  110. instant, and, in fact, as quickly as short files.
  111.  
  112.  
  113.                            IV. How to Use MULTIBAK
  114.  
  115. In the following discussion, we will use the name MULTIBAK when we wish to
  116. describe commands or features common to both the COPY model, MBC.EXE, and
  117. the RENAME model, MBR.EXE.
  118.  
  119. At a DOS prompt (such as "C>") MULTIBAK is called as follows:
  120.  
  121.        C>MULTIBAK filespec [backup filename root] [max files]
  122.  
  123. (the arguments in square brackets, as usual, being optional). 
  124.  
  125. "Filespec" refers to the specification of the file to be backed up. It can be
  126. a "full" specification, including an optional drive and directory path.  
  127.  
  128. The "backup filename root," if provided, over-rides the default filename for
  129. backup files, which is described above (Section III). The rules for
  130. constructing this argument are provided below, Section V.
  131.  
  132. "Max files," the final argument, specifies the maximum number of versions to
  133. be saved. That value can be any number up to 99. If this optional argument is
  134. provided, it over-rides the program default of 50. In case very large files
  135. are saved when disk space is at a premium, it might be set as low as 2 or 3.
  136. When plenty of disk space is available, or files are short and the recovery of
  137. earlier versions might be critical, a value of 99 makes sense. Since the
  138. program seeks the lowest integer available for a new backup by searching for
  139. existing files starting at the maximum and proceeding down, an unnecessarily
  140. large number might slightly slow execution. Note that "max files" can not be
  141. entered unless an explicit "backup filename root" is also entered:  otherwise
  142. the number entered as the maximum number of files will be taken as the file
  143. name root.  For example, on its first execution
  144.  
  145.     MBC MYFILE 10
  146.  
  147. will produce a backup of MYFILE named "10.-1".
  148.  
  149.     MBC MYFILE MYFILE 10
  150.  
  151. will produce what is desired, a backup named "MYFILE.-1" searching only from
  152. 10 to 1 instead of from 50 to 1 for already existing backup files.
  153.  
  154. In all of the following examples, the file to be backed up is understood to be
  155. C:\SUBDIR\MYFILE.EXT. MBC.EXE and MBR.EXE are either in the current default
  156. directory or in the directory path. MULTIBAK means either MBC or MBR.
  157.  
  158. 1. Succession of executions of COPY model, with default backup filenames.
  159.  
  160. Command                     Files existing after command executed.
  161. -------                     --------------------------------------
  162.  
  163. C>MBC MYFILE.EXT              C:\SUBDIR\MYFILE.EXT
  164.                               C:\SUBDIR\MYFILE.E1
  165.  
  166. C>MBC MYFILE.EXT              c:\subdir\MYFILE.EXT
  167.                               c:\subdir\MYFILE.E1
  168.                               c:\subdir\MYFILE.E2
  169.  
  170.                                     ******
  171.  
  172. 2. Succession of executions of RENAME model, with default backup filenames.
  173.  
  174. Command                     Files existing after command executed.
  175. -------                     --------------------------------------
  176.  
  177. C>MBR MYFILE.EXT              C:\SUBDIR\MYFILE.E1
  178.  
  179. C>MBR MYFILE.EXT              C:\SUBDIR\MYFILE.E1
  180.                               C:\SUBDIR\MYFILE.E2
  181.  
  182. Note: Ordinarily, in this case, another program such as a word processor would
  183. create a new version of MYFILE.EXT when MULTIBAK creates a backup.
  184.  
  185.                                     *****
  186.  
  187. 3. Backup to a different directory.
  188.  
  189. Command                             Files existing after command executed.
  190. -------                             --------------------------------------
  191.  
  192. C>MBC MYFILE.EXT \ALTDIR\MYFILE      C:\SUBDIR\MYFILE.EXT
  193.                                      C:\ALTDIR\MYFILE.E1
  194.  
  195.                                       or
  196.  
  197. C>MBR MYFILE.EXT \ALTDIR\MYFILE      C:\ALTDIR\MYFILE.E1
  198.  
  199.                                     *****
  200.  
  201. 4. Backup to a different drive.
  202.         
  203. Command                             Files existing after command executed.
  204. -------                             --------------------------------------
  205.  
  206. C>MBC MYFILE.EXT D:\ANYDIR\MYFILE     C:\SUBDIR\MYFILE.EXT
  207.                                       D:\ANYDIR\MYFILE.E1
  208.  
  209.                                     *****
  210.  
  211. 5. Backup to a new backup filename.
  212.  
  213. Command                             Files existing after command executed.
  214. -------                             --------------------------------------
  215.  
  216. C>MULTIBAK MYFILE.EXT BACKFILE        C:\SUBDIR\MYFILE.EXT
  217.                                       C:\SUBDIR\BACKFILE.E1
  218.  
  219.                                     *****
  220.  
  221. 5. Backup using the same filename, to a different drive and directory.
  222.  
  223. Command                             Files existing after command executed.
  224. -------                             --------------------------------------
  225.  
  226. C>MBC MYFILE.EXT D:\ANYDIR\MYFILE     C:\SUBDIR\MYFILE.EXT
  227.                                       D:\ANYDIR\MYFILE.E1   
  228.  
  229. NOTE: In this example, the explicit filename MYFILE may NOT be omitted in
  230. specifying the backup filename, even though it may be omitted when calling the
  231. DOS COPY program.
  232.  
  233.  
  234.                          V. The Backup Filename Root
  235.  
  236. The "backup filename root," if provided, over-rides the default filename for
  237. backup files. It is called a "root" since an extension including a sequence
  238. number is appended to it to construct the full backup filename. 
  239.  
  240. The filename root:
  241.  
  242.      MUST include a first name for the backup file;
  243.      MAY include a directory path;
  244.      MUST NOT include an extension. If one is entered, it is ignored.
  245.  
  246. The extension will always be assigned by the program, by the rules described
  247. above. 
  248.  
  249. The rule on including a drive in the backup filename root differs for the COPY
  250. and the RENAME models.  
  251.  
  252.      You MAY include ANY drive when executing the COPY model.
  253.      You MUST include the same drive if any is named in "filespec," i.e., the
  254.         drive of the original file, when executing the RENAME model.
  255.  
  256. For example:
  257.  
  258.              C>MBR D:\SUBDIR\FILE.EXT D:\NEWDIR\BACKUP 
  259.  
  260. is a correct command line entered from the current default disk C:, which
  261. would rename the current version of FILE.EXT in directory \SUBDIR of
  262. disk D: to one of BACKUP.E1, BACKUP.E2, BACKUP.E3, etc. (using the first
  263. unused integer) in directory \NEWDIR of disk D:.
  264.  
  265. If the second "D:" is omitted, 
  266.  
  267.              C>MBR D:\SUBDIR\FILE.EXT \NEWDIR\BACKUP
  268.  
  269. the command will be interpreted as an attempt to backup a file located on D:,
  270. by renaming, to drive C:, the default drive, and the error message "Can not
  271. back up to a different drive"  will appear on the screen. On the other hand,
  272.  
  273.              C>MBC D:\SUBDIR\FILE.EXT \NEWDIR\BACKUP
  274.  
  275. using the COPY version, will create the backup file demanded:
  276. C:\NEWDIR\BACKUP.E?? where ?? represents a sequence number.
  277.  
  278.  
  279.                                VI. PURGE
  280.  
  281. PURGE permits the deletion of selected generations of backup files created by
  282. MULTIBAK. Particularly when files are long, storing many  generations could
  283. use considerable disk space to little purpose.  But the chore of erasing large
  284. numbers of backups might be  burdensome, since wild cards would probably wipe
  285. out useful files, including the current version.  PURGE permits the user to
  286. select the generations to be erased with a single command. On each execution
  287. of MULTIBAK, the user is advised of the size in bytes and the serial number of
  288. the new backup, so that he can use the purge facility when he feels the number
  289. of backups is becoming excessive.
  290.  
  291. PURGE is called at the DOS prompt as follows:
  292.  
  293.        C>PURGE [filename] [highest sequence number] [starting sequence number]
  294.  
  295. where the "filename" is the name of the file whose backups are to be erased,
  296. including an optional drive, directory, and extension. The "highest sequence
  297. number" option permits erasing only the oldest generations, up to the
  298. specified number. Thus, if a file has 12 generations of backup on disk it is
  299. possible to erase, for example, the first six, or the first eleven. The second
  300. argument to PURGE, the starting sequence number, permits still more
  301. flexibility, the erasing of only the generations beginning at the number
  302. entered.  Thus, if a file named "PROGRAM.C" has been backed up 8 times the
  303. directory will show:
  304.  
  305.  PROGRAM.C1 
  306.  PROGRAM.C2
  307.  PROGRAM.C3
  308.  PROGRAM.C4
  309.  PROGRAM.C5
  310.  PROGRAM.C6
  311.  PROGRAM.C7
  312.  PROGRAM.C8
  313.  
  314. After execution of
  315.  
  316.      C:>PURGE PROGRAM.C 6 3
  317.  
  318. the disk will hold:
  319.  
  320.  PROGRAM.C1
  321.  PROGRAM.C2
  322.  PROGRAM.C7
  323.  PROGRAM.C8
  324.  
  325. If, as in this case, the sequence is broken, C>PURGE PROGRAM.C will erase
  326. files only until it finds a missing backup, i.e., in this case, it will erase
  327. PROGRAM.C1 and PROGRAM.C2. If, however, an upper limit is given as an argument
  328. to the command line all files up to that limit will be erased, regardless of
  329. missing versions. Thus, all files in the broken list above will be deleted by
  330. the command  C>PURGE PROGRAM.C 8.
  331.  
  332. These rules present an apparent danger to any file with an extension composed
  333. exclusively of two digits. When MULTIBAK backs up a file called FILE.12 its
  334. first backup will be called FILE.11, and its second backup will be called
  335. FILE.13. (If FILE.12 exists, it will skip that name.) Now the original file,
  336. FILE.12, appears to the computer as it does to a human observer as
  337. indistinguishable from a backup, and the command PURGE FILE.12 would seem to
  338. destroy the current version, FILE.12, along with its backups.  PURGE, however,
  339. is programmed to avoid this;  it will never erase the current version entered
  340. as its first argument on the command line.
  341.  
  342. Examples of the Use of PURGE
  343. ============================
  344.  
  345.                   Erasing all backup files:  PURGE MYFILE
  346.  
  347. Files existing before command       Files existing after command
  348. =============================       ============================
  349.  
  350.  MYFILE.EXT                             MYFILE.EXT
  351.  MYFILE.E1
  352.  MYFILE.E2
  353.  MYFILE.E3
  354.  
  355.  
  356.           Erasing all backups except the most recent:   PURGE MYFILE 2
  357.  
  358. Files existing before command       Files existing after command
  359. =============================       ============================
  360.  
  361.  MYFILE.EXT                             MYFILE.EXT
  362.  MYFILE.E1                              MYFILE.E3
  363.  MYFILE.E2 
  364.  MYFILE.E3
  365.  
  366.  
  367.          Erasing all except the first two backups:  PURGE MYFILE 4 3
  368.  
  369. Files existing before command       Files existing after command
  370. =============================       ============================
  371.  
  372.  MYFILE.EXT                             MYFILE.EXT
  373.  MYFILE.E1                              MYFILE.E1
  374.  MYFILE.E2                              MYFILE.E2
  375.  MYFILE.E3
  376.  MYFILE.E4
  377.  
  378.  
  379.                  VII. Executing MULTIBAK from Other Programs
  380.  
  381. While MULTIBAK can be called from the DOS prompt like any other program, it is
  382. specifically designed to be called from within applications that write
  383. modifications to files and provide either a DOS command call facility or a DOS
  384. Shell option.  For example, SPRINT is an editor that, like many others,
  385. provides a macro, "call," that executes a DOS command.  The following macro
  386. can be bound to a function key, so that it executes each time that key is
  387. pressed:
  388.  
  389.         call MBR fname write fname
  390.  
  391. This stores the  current version of the file being edited (SPRINT calls it
  392. "fname") without destroying previous backup versions, and then writes the
  393. newly edited version to disk, under the original file name. This backup
  394. procedure is very fast, and can be called a dozen times or more in a given
  395. editing session, so as to provide the possibility of returning to many
  396. different versions if desired. At the end of an editing session, some or all
  397. of these backups can be PURGEd.
  398.  
  399. The popular word processor Word Perfect offers a different method of using
  400. MULTIBAK while editing.  Instead of a macro for executing a DOS command,
  401. Word Perfect offers a "shell" command. Pressing Control-F1, the user sees a 
  402. DOS prompt, which enables him to execute any DOS command including MBR or
  403. MBC.
  404.  
  405.  
  406.                                VIII. Disclaimer
  407.  
  408. Used properly, this software will perform as described. By using this
  409. software, you acknowledge that this software may not suit your particular
  410. requirements or be completely trouble-free. We are not responsible for your
  411. specific application or any problems resulting from use of this software. We
  412. have no liability to you or any other person or entity for any damage or loss,
  413. including special, incidental, or consequential damages, caused by this
  414. software, directly or indirectly.  Some states do not allow the limitation or
  415. exclusion of liability for incidental or consequential damages, so the above
  416. limitation or exclusion may not apply to you.
  417.  
  418.